<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Amaze UI Admin table Examples</title>
  <meta name="description" content="这是一个 table 页面">
  <meta name="keywords" content="table">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="/Public/assets/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="/Public/assets/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="/Public/assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="/Public/assets/css/admin.css">
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

<header class="am-topbar am-topbar-inverse admin-header">
  <div class="am-topbar-brand">
    <strong>Shop UI</strong> <small>商城后台管理</small>
  </div>

  <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

  <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

    <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
      <li><a href="javascript:;"><span class="am-icon-envelope-o"></span> 收件箱 <span class="am-badge am-badge-warning">5</span></a></li>
      <li class="am-dropdown" data-am-dropdown>
        <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
          <span class="am-icon-users"></span> 管理员 <span class="am-icon-caret-down"></span>
        </a>
        <ul class="am-dropdown-content">
          <li><a href="#"><span class="am-icon-user"></span> 资料</a></li>
          <li><a href="#"><span class="am-icon-cog"></span> 设置</a></li>
          <li><a href="#"><span class="am-icon-power-off"></span> 退出</a></li>
        </ul>
      </li>
      <li class="am-hide-sm-only"><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>
    </ul>
  </div>
</header>


<div class="am-cf admin-main">
  <!-- sidebar start -->
  <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
	<div class="am-offcanvas-bar admin-offcanvas-bar">
	  <ul class="am-list admin-sidebar-list">
		<li><a href="/Admin/index"><span class="am-icon-home"></span> 首页</a></li>
		<li class="admin-parent">
		  <a class="am-cf" data-am-collapse="{target: '#collapse-nav'}"><span class="am-icon-file"></span> 管理列表 <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
		  <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav">
			<li><a href="/Admin/account/add" class="am-cf"><span class="am-icon-check"></span> 管理员添加<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
			<li><a href="/Admin/user/ulist" class="am-cf"><span class="am-icon-check"></span> 会员管理<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
			<li><a href="/Admin/type/tlist" class="am-cf"><span class="am-icon-check"></span> 商品分类<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
			<li><a href="/Admin/ware/wlist" class="am-cf"><span class="am-icon-check"></span> 商品管理<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
			<li><a href="/Admin/order/olist" class="am-cf"><span class="am-icon-check"></span> 订单管理<span class="am-icon-star am-fr am-margin-right admin-icon-yellow"></span></a></li>
		  </ul>
		</li>
		<li><a href="/Admin/login/loginout"><span class="am-icon-sign-out"></span> 注销</a></li>
	  </ul>

      <div class="am-panel am-panel-default admin-sidebar-panel">
        <div class="am-panel-bd">
          <p><span class="am-icon-bookmark"></span> 公告</p>
          <p>时光静好，与君语；细水流年，与君同。—— Amaze UI</p>
        </div>
      </div>

      <div class="am-panel am-panel-default admin-sidebar-panel">
        <div class="am-panel-bd">
          <p><span class="am-icon-tag"></span> wiki</p>
          <p>Welcome to the Amaze UI wiki!</p>
        </div>
      </div>
    </div>
</div>

  <!-- sidebar end -->

  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">订单管理</strong> / <small>Order</small></div>
      </div>

      <hr>

      <div class="am-g">
        <div class="am-u-sm-12 am-u-md-6">
          <div class="am-btn-toolbar">
            <div class="am-btn-group am-btn-group-xs">
              <a href="/Admin/ware/add" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 新增</a>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-trash-o"></span> 删除</button>
            </div>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-3">
          <div class="am-form-group">
            
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-3">
          <div class="am-input-group am-input-group-sm">
            <input type="text" class="am-form-field">
          <span class="am-input-group-btn">
            <button class="am-btn am-btn-default" type="button">搜索</button>
          </span>
          </div>
        </div>
      </div>

      <div class="am-g">
        <div class="am-u-sm-12">
          <form class="am-form">
            <table class="am-table am-table-striped am-table-hover table-main">
              <thead>
              <tr>
                <th class="table-check"><input type="checkbox" /></th><th class="table-id">ID</th>
                <th class="table-title">订单编号</th>
                <th class="table-title">买家名字</th>
                <th class="table-title">付款金额</th>
                <th class="table-title">成交状态</th>
                <th class="table-title">成交时间</th>
                <th class="table-set">操作</th>
              </tr>
              </thead>
              <tbody>
			  <?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
				<td><input type="checkbox" /></td>
				<td><?php echo ($i); ?></td>
				<td class="orderid" width="150px;"><?php echo ($vo["order_id"]); ?></td>
				<td width="150px;"><?php echo ($vo["user_name"]); ?></td>
				<td width="100px;"><?php echo ($vo["payprice"]); ?></td>
				<td class="cn-status" width="100px;"></td>
				<input type="hidden" class="status" value="<?php echo ($vo["status"]); ?>">
				<td width="120px"><?php echo (date("y-m-d H:i:s",$vo["addtime"])); ?></td>
				<td class="btn">
				  <div class="am-btn-toolbar">
					<div class="am-btn-group am-btn-group-xs">
					  <a onclick="changestatus(this);" class="am-btn am-btn-default am-btn-xs am-text-secondary btnopen"><span class="am-icon-pencil-square-o"></span> 点击发货</a>
					</div>
				  </div>
				</td>
              </tr><?php endforeach; endif; else: echo "" ;endif; ?>
              
              </tbody>
            </table>
            <div class="am-cf">
              
              <div class="am-fr">
                <ul class="am-pagination">
                  
                </ul>
              </div>
            </div>
            <hr />
            
          </form>
        </div>

      </div>
    </div>

    

  </div>
  <!-- content end -->
</div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

<footer class="admin-content-footer">
  <hr>
  <p class="am-padding-left">© 2017 AllMobilize, Inc. Licensed under MIT license.</p>
</footer>




<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/Public/assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="/Public/assets/js/amazeui.min.js"></script>
<script src="/Public/assets/js/app.js"></script>

</body>
<script>
<!--页面默认设置-->
function olistindex(){
	$('.status').each(function(){
		var sta = $(this).val();
		if( sta == 2){
			$(this).prev('.cn-status').html('待发货');
		}
		else if( sta == 1){
			$(this).prev('.cn-status').html('待付款');
		}
		else if( sta == 3){
			$(this).prev('.cn-status').html('待收货');
		}
		else if( sta == 4){
			$(this).prev('.cn-status').html('带评价');
		}
		else{
			$(this).prev('.cn-status').html('已评价');
		}
	})
}
olistindex();
<!--发货按钮-->
function changestatus(obj){
	var status = $(obj).parents('.btn').siblings('.status').val();
	var order_id = $(obj).parents('.btn').siblings('.orderid').html();
	if( status == 2){
		$.get('/Api/order/orderchange' , {order_id:order_id} , function(ret){
			if( ret.status == true){
				alert( ret.data);
				window.location.href="";
			}
			else{
				alert( ret.data);
			}
		});
	}
	else if( status == 1){
		alert('未付款');
	}
	else if ( status == 3){
		alert('待收货')
	}
	else if ( status == 4){
		alert('待评价')
	}
	else{
		alert('已评价');
	}
}
</script>
</html>